<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>后台登录</title>
<link href="${pageContext.request.contextPath }/js/login/css/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/login/js/fun.base.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/login/js/login.js"></script>
<script type="text/javascript">
function reload(){
	$("#cdImg").attr('src','${pageContext.request.contextPath}/image.jsp?imageId=cdImg&r='+Math.random());
}
function validCaptcha() {
	var isFlag = true;
	$.ajax({
		url:'${pageContext.request.contextPath}/isRightCaptCha.html',
		type:'post',
		async:false,
		data:{captCha:$('#captcha').val(),captchaImgId:'cdImg'},
		success:function(data){
			if (!data.successful) {
				alert(data.message);
				isFlag = false;
				reload();
			}
		},
		error:function(){
			alert("网络有误 ！请稍后重试");
			reload();
			isFlag = false;
		}
	});
	return isFlag;
}
</script>
</head>
<body>
<div class="login">
	<div class="menus">
    	<div class="public"><a href="${pageContext.request.contextPath }">网站首页</a></div>
    </div>
    <div class="box png">
    	<s:form method="POST" onsubmit="return validCaptcha()" action="login.html">
        <div class="header">
            <span class="alt">管理员登录</span>
        </div>
        <ul>
            <li><label>用户名</label><input name="obj.loginCode" type="text" class="text" style="width: 188px"/></li>
            <li><label>密　码</label><input name="obj.passwd" type="password" class="text" style="width: 188px"/></li> 
            <li><label>验证码</label><span style="font-size: 9pt"><input name="" type="text" class="text" style="width: 60px" maxlength="4" id="captcha"/>
            &nbsp;&nbsp;
                            </span><img src="${pageContext.request.contextPath}/image.jsp?imageId=cdImg&r=<%=Math.random()%>" id="cdImg" align="absmiddle" width="71" height="24" onclick="reload()"/>
            </li>
            <li class="submits"><input class="submit" type="submit" value="登录" /></li>
        </ul>
        </s:form>
    </div>
    <div class="air-balloon ab-2 png"></div>
    <div class="footer"></div>
</div>



<!--[if lt IE 8]>
<script src="jslib/PIE.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
    if (window.PIE && ( $.browser.version >= 6 && $.browser.version < 10 )){
        $('input.text,input.submit').each(function(){
            PIE.attach(this);
        });
    }
});
</script>
<![endif]-->

<!--[if IE 6]>
<script src="jslib/DD_belatedPNG.js" type="text/javascript"></script>
<script>DD_belatedPNG.fix('.png')</script>
<![endif]-->
</body>
</html>